package com.taptech.doufu.weex.module;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.common.WXModule;
import com.taptech.doufu.manager.UserLogManager;

/**
 * Created by Wyatt on 2017/12/10.
 */

public class TFUserLogModule extends WXModule {


    @JSMethod
    public void weexClickEvent(String eventName, String data) {
        String novelID = "";
        String clickPlace = "";
        JSONObject jsonObject = JSON.parseObject(data);
        if (jsonObject!=null){
            if (jsonObject.containsKey("novelID")){
                novelID = jsonObject.getString("novelID");
            }
            if (jsonObject.containsKey("clickPlace")){
                clickPlace = jsonObject.getString("clickPlace");
            }
        }
        UserLogManager.addLog(eventName,novelID,clickPlace);
    }
}
